package demo4;


class Person {
    public String name;
    public int age;
    public String sex;
}

class Student extends Person {
    public void study() {
        System.out.println(name + " 正在学习");
    }
}
class Teacher extends Person {
    public void teach() {
        System.out.println(name + " 正在教学");
    }
}

public class Test4 {
    public static void main(String[] args) {
        Student student = new Student();
        student.name = "zhangsan";
        student.age = 12;
        student.study();
        Teacher teacher = new Teacher();
        teacher.name = "lisi";
        teacher.age = 30;
        teacher.teach();
    }
}
